package com.easy.stock.dao;

import com.easy.stock.domain.StockArticle;

public class StockArticleDao extends BaseDao {
	
	public void addArticle(StockArticle article) {
		if(article==null)
			return;
		
		getCollection().update("{_id:\""+article.getUrl()+"\"}").upsert().with(article);
	}
	
	public boolean isArticleExists(String url) {
		StockArticle article = getCollection().findOne("{_id:\""+url+"\"}, {content:0,summary:0}").as(StockArticle.class);
		return article!=null;
	}
	
}
